package cn.dogeye.controller;


import cn.dogeye.entity.SysUser;
import cn.dogeye.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.servlet.http.HttpSession;
import java.time.LocalTime;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/sys")
public class SysUserController {

    @Autowired
    SysUserService sysUserService;
    @Autowired
    private RestTemplate restTemplate;

    /*获得系统用户权限*/
    @GetMapping("/authorities")
    public SysUser getSysuserAuthorities(@RequestParam("username") String uname) {
        if(1==1){
            throw new RuntimeException("我的异常");
        }
        SysUser user = sysUserService.getSysUserByName(uname);
        return user;
    }
}
